#!/usr/bin/env python
# coding: utf-8

'''
python parse_config_file.py
命令行中 --logging=none 可关闭控制台输出的日志
'''

import tornado.web
import tornado.options
import tornado.httpserver
import tornado.ioloop

tornado.options.define(name='port', default=8000, type=int, help='given a port')
tornado.options.define(name='list', default=[], type=str, multiple=True, help='given a list separate by ","')

class IndexHandler(tornado.web.RequestHandler):
    def get(self):
        pass

if __name__ == "__main__":
    tornado.options.parse_config_file('config.txt')
    print(tornado.options.options.list)
    app = tornado.web.Application([
        (r'/', IndexHandler),
    ])
    http_server = tornado.httpserver.HTTPServer(app)
    http_server.listen(tornado.options.options.port)
    tornado.ioloop.IOLoop.current().start()
